package demo4;

import java.util.Arrays;

public class Tect {
    public static void main(String[] args)throws CloneNotSupportedException {
        Student student1 = new Student(12,"张三");
        Student student2 =(Student) student1.clone();
    }
    public static void main1(String[] args) {
       Student student1 = new Student(1,"1");
       Student student2 = new Student(2,"2");
       Student student3 = new Student(3,"3");
       Student[] students ={student1 ,student2 ,student3 };
          //默认使用Student类中的compareTo的比较方法
        Arrays.sort(students);
          //传入比较器，进行排序
        AgeCompare ageCompare = new AgeCompare();
        Arrays.sort(students,ageCompare);
    }
}
